#ifndef __SESSIONMANAGER_HPP_
#define __SESSIONMANAGER_HPP_


#include <boost/shared_ptr.hpp>
#include <boost/noncopyable.hpp>
#include <set>

    namespace network
    {

        template< class T >
        class SessionManager
        : private boost::noncopyable
        {
        public:
            /**
             * Start a new session, calling its start function and add it in the set
             * @param   io_service_ asio service for network
             */
            virtual void start(T s) = 0;

            /**
             * Remove a session,remove it from the set and call the stop function of the session
             * @param s shared pointer toward a session
             */
            virtual void stop(T s) = 0;

            /**
             * Close all the sessions in the set
             */
            virtual void stop_all() = 0;

            virtual ~SessionManager()
            {
            };

        protected:
            /**
             * Set of pointers toward sessions, pointers are shared pointers
             * shared_ptr.
             * @see http://c.developpez.com/faq/cpp/?page=boost#BOOST_shared_ptr
             */
            std::set<T> m_sessions;

        };

    } //  // namespace network

#endif // __SESSIONMANAGER_HPP_
